package helpers;

import java.util.Locale;
import java.util.ResourceBundle;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class LanguageHelper {
	private ResourceBundle translate;
	
	private String language = "en";
	
	private HttpSession session;
	
	public LanguageHelper(HttpServletRequest request) {
		
		language = (String) request.getAttribute("language");
		translate = ResourceBundle.getBundle("language", new Locale(language));
	}
	
	public String getString(String key) {
		String value = "";
		try {
			value = translate.getString(key);
		} catch (Exception e) {}
		return value; 
	}
}
